﻿<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../../assets/docs.css" rel="stylesheet" type="text/css" media="screen" />
<title>MooTools Documentation - Types/Function</title>
</head>

<body>
  <div id="docs" class="doc">
    <div class="methods">
      <h4 class="menu-item"><a href="#Function">Function</a></h4>
      <div class="menu-item"><a href="#Function:Function-from">Function.from</a></div>
      <div class="menu-item"><a href="#Function:Function-attempt">Function.attempt</a></div>
      <div class="menu-item"><a href="#Function:extend">extend</a></div>
      <div class="menu-item"><a href="#Function:implement">implement</a></div>
      <div class="menu-item"><a href="#Function:attempt">attempt</a></div>
      <div class="menu-item"><a href="#Function:pass">pass</a></div>
      <div class="menu-item"><a href="#Function:bind">bind</a></div>
      <div class="menu-item"><a href="#Function:delay">delay</a></div>
      <div class="menu-item"><a href="#Function:periodical">periodical</a></div>
      <h4 class="menu-item"><a href="#Deprecated-Functions">Deprecated.Functions</a></h4>
      <div class="menu-item"><a href="#Deprecated-Functions:create">create</a></div>
      <div class="menu-item"><a href="#Deprecated-Functions:bindWithEvent">bindWithEvent</a></div>
      <div class="menu-item"><a href="#Deprecated-Functions:run">run</a></div>
    </div>
    <div class="l-border r-border span-15 content">
				<h1 id="Function"><a href="#Function">Type: Function</a></h1>

<p class="description">Function Methods.</p>

<h3>See Also:</h3>

<ul>
<li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">MDC Function</a></li>
</ul>
<h2 id="Function:Function-from"><a href="#Function:Function-from">Function: Function.from</a></h2>

<p class="description">If the passed argument is a function, it will return itself. Otherwise, it will return a function that returns the passed argument.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">var</span> foo = <span class="kw2">Function</span>.<span class="me1">from</span><span class="br0">(</span>obj<span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>obj - (<em>mixed</em>) If this argument is a function, it will simply return itself. Otherwise, an object you wish to convert into a function that returns the argument.</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>function</em>) Either the passed function or an anonymous function that returns the passed argument.</li>
</ul>
<h3>Examples:</h3>

<pre class="javascript"><span class="kw2">var</span> fn = <span class="kw2">Function</span>.<span class="me1">from</span><span class="br0">(</span><span class="nu0">42</span><span class="br0">)</span>;
<span class="kw3">alert</span><span class="br0">(</span>fn<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>;    <span class="co1">// alerts '42'</span>
&nbsp;
<span class="kw2">var</span> fn2 = <span class="kw2">Function</span>.<span class="me1">from</span><span class="br0">(</span>fn<span class="br0">)</span>;
<span class="kw3">alert</span><span class="br0">(</span>fn2<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>;   <span class="co1">// alerts '42'</span>
</pre>

<h3>Notes:</h3>

<p>This function is equivalent to the following deprecated MooTools 1.2 methods:</p>

<pre class="javascript"><span class="kw2">var</span> fn1 = <span class="kw2">Function</span>.<span class="me1">from</span><span class="br0">(</span><span class="br0">)</span>;      <span class="co1">// equivalent to var fn1 = function(){};</span>
<span class="kw2">var</span> fn2 = <span class="kw2">Function</span>.<span class="me1">from</span><span class="br0">(</span>foo<span class="br0">)</span>;   <span class="co1">// equivalent to var fn2 = function(){ return foo; };</span>
</pre>

<h2 id="Function:Function-attempt"><a href="#Function:Function-attempt">Function: Function.attempt</a></h2>

<p class="description">Tries to execute a number of functions. Returns immediately the return value of the first non-failed function without executing successive functions, or null.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">Function</span>.<span class="me1">attempt</span><span class="br0">(</span>fn<span class="br0">[</span>, fn, fn, fn, ...<span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ul>
<li>fn   - (<em>function</em>) Any number of functions to execute.</li>
</ul>
<h3>Returns:</h3>

<ul>
<li>(<em>mixed</em>) Standard return of the called function.</li>
<li>(<em>null</em>) <code>null</code> if all the passed functions fail.</li>
</ul>
<h3>Examples:</h3>

<pre class="javascript"><span class="kw2">var</span> result = <span class="kw2">Function</span>.<span class="me1">attempt</span><span class="br0">(</span><span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> some.<span class="me1">made</span>.<span class="me1">up</span>.<span class="me1">object</span>;
<span class="br0">}</span>, <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> jibberish.<span class="me1">that</span>.<span class="me1">doesnt</span>.<span class="me1">exists</span>;
<span class="br0">}</span>, <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> <span class="kw2">false</span>;
<span class="br0">}</span><span class="br0">)</span>;
&nbsp;
<span class="co1">//result is false</span>
&nbsp;
<span class="kw2">var</span> failure, success;
&nbsp;
<span class="kw2">Function</span>.<span class="me1">attempt</span><span class="br0">(</span><span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    some.<span class="me1">made</span>.<span class="me1">up</span>.<span class="me1">object</span> = <span class="st0">'something'</span>;
    success = <span class="kw2">true</span>;
<span class="br0">}</span>, <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    failure = <span class="kw2">true</span>;
<span class="br0">}</span><span class="br0">)</span>;
&nbsp;
<span class="kw1">if</span> <span class="br0">(</span>success<span class="br0">)</span> <span class="kw3">alert</span><span class="br0">(</span><span class="st0">'yey!'</span><span class="br0">)</span>;
</pre>

<h3>Notes:</h3>

<p>This method is an equivalent of <em>$try</em> from MooTools 1.2.</p>

<h2 id="Function:extend"><a href="#Function:extend">Function method: extend</a></h2>

<p class="description">Extends a function with a new method or property.</p>

<h3>Syntax:</h3>

<pre class="javascript">myFunction.<span class="me1">extend</span><span class="br0">(</span>key, value<span class="br0">)</span>;
&nbsp;
<span class="co1">// Or</span>
&nbsp;
myFunction.<span class="me1">extend</span><span class="br0">(</span>object<span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>key - (<em>string</em>) The key of the method or property</li>
<li>value - (<em>mixed</em>) The function or property value</li>
</ol>
<p>Or</p>

<ol>
<li>object - (<em>object</em>) An object with the key value pairs to add multiple methods or properties</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>function</em>) The function</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span><span class="br0">}</span>;
myFunction.<span class="me1">extend</span><span class="br0">(</span><span class="st0">'alert'</span>, <span class="kw2">function</span><span class="br0">(</span>text<span class="br0">)</span><span class="br0">{</span>
    <span class="kw3">alert</span><span class="br0">(</span>text<span class="br0">)</span>;
<span class="br0">}</span><span class="br0">)</span>;
myFunction.<span class="kw3">alert</span><span class="br0">(</span><span class="st0">'Hello!'</span><span class="br0">)</span>; <span class="co1">// alerts Hello!</span>
&nbsp;
<span class="co1">// Using objects</span>
myFunction.<span class="me1">extend</span><span class="br0">(</span><span class="br0">{</span>
    <span class="kw3">alert</span>: <span class="kw2">function</span><span class="br0">(</span>text<span class="br0">)</span><span class="br0">{</span>
        <span class="kw3">alert</span><span class="br0">(</span>text<span class="br0">)</span>;
    <span class="br0">}</span>
<span class="br0">}</span><span class="br0">)</span>;
</pre>

<h2 id="Function:implement"><a href="#Function:implement">Function method: implement</a></h2>

<p class="description">Implements a method to the prototype of the function.</p>

<h3>Syntax:</h3>

<pre class="javascript">myFunction.<span class="me1">implement</span><span class="br0">(</span>key, value<span class="br0">)</span>;
&nbsp;
<span class="co1">// Or</span>
&nbsp;
myFunction.<span class="me1">implement</span><span class="br0">(</span>object<span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>key - (<em>string</em>) The method of property name in the prototype</li>
<li>value - (<em>mixed</em>) The function or another value in the prototype</li>
</ol>
<p>Or</p>

<ol>
<li>object - (<em>object</em>) An object with key-value pairs to add multiple methods or properties to the function it's prototype.</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>function</em>) The function</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span><span class="br0">}</span>;
myFunction.<span class="me1">implement</span><span class="br0">(</span><span class="st0">'alert'</span>, <span class="kw2">function</span><span class="br0">(</span>text<span class="br0">)</span><span class="br0">{</span>
    <span class="kw3">alert</span><span class="br0">(</span>text<span class="br0">)</span>;
<span class="br0">}</span><span class="br0">)</span>;
<span class="kw2">var</span> myInstance = <span class="kw2">new</span> myFunction<span class="br0">(</span><span class="br0">)</span>;
myInstance.<span class="kw3">alert</span><span class="br0">(</span><span class="st0">'Hello!'</span><span class="br0">)</span>; <span class="co1">// alerts Hello!</span>
&nbsp;
<span class="co1">// Using objects</span>
myInstance.<span class="me1">implement</span><span class="br0">(</span><span class="br0">{</span>
    <span class="kw3">alert</span>: <span class="kw2">function</span><span class="br0">(</span>text<span class="br0">)</span><span class="br0">{</span>
        <span class="kw3">alert</span><span class="br0">(</span>text<span class="br0">)</span>;
    <span class="br0">}</span>
<span class="br0">}</span><span class="br0">)</span>;
</pre>

<h3>Notes:</h3>

<p>The difference between <em>implement</em> and <em>extend</em>, is that implement adds the value to the prototype.
So with <em>implement</em> each instance of the function will have this method or property while with <em>extend</em>
the method or property is added to a single instance.</p>

<h2 id="Function:attempt"><a href="#Function:attempt">Function method: attempt</a></h2>

<p class="description">Tries to execute a single function. Returns immediately the return value of the function if it does not fail, or null.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunctionResult = myFunction.<span class="me1">attempt</span><span class="br0">(</span>args<span class="br0">[</span>, bind<span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>args - (<em>mixed</em>) An argument, or array of arguments to run the function with.</li>
<li>bind - (<em>object</em>, optional) The object that the "this" of the function will refer to.</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>mixed</em>) This Function's return value.</li>
<li>(<em>null</em>) <code>null</code> if the function fails.</li>
</ul>
<h3>Examples:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> some.<span class="me1">made</span>.<span class="me1">up</span>.<span class="me1">object</span>;
<span class="br0">}</span>;
myFunction.<span class="me1">attempt</span><span class="br0">(</span><span class="br0">)</span>; <span class="co1">// returns 'null'</span>
&nbsp;
&nbsp;
<span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span>val<span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> val;
<span class="br0">}</span>;
myFunction.<span class="me1">attempt</span><span class="br0">(</span><span class="kw2">false</span><span class="br0">)</span>; <span class="co1">// returns 'false'</span>
</pre>

<h3>See Also:</h3>

<ul>
<li>See <a href="#Function:Function-attempt">Function.attempt</a> for using more than one functions.</li>
</ul>
<h2 id="Function:pass"><a href="#Function:pass">Function method: pass</a></h2>

<p class="description">Returns a closure with arguments and bind.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">var</span> newFunction = myFunction.<span class="me1">pass</span><span class="br0">(</span><span class="br0">[</span>args<span class="br0">[</span>, bind<span class="br0">]</span><span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>args - (<em>mixed</em>, optional) The arguments to pass to the function (must be an array if passing more than one argument).</li>
<li>bind - (<em>object</em>, optional) The object that the "this" of the function will refer to.</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>function</em>) The function whose arguments are passed when called.</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw2">var</span> result = <span class="st0">'Passed: '</span>;
    <span class="kw1">for</span> <span class="br0">(</span><span class="kw2">var</span> i = <span class="nu0">0</span>, l = arguments.<span class="me1">length</span>; i &lt; l; i++<span class="br0">)</span><span class="br0">{</span>
        result += <span class="br0">(</span>arguments<span class="br0">[</span>i<span class="br0">]</span> + <span class="st0">' '</span><span class="br0">)</span>;
    <span class="br0">}</span>
    <span class="kw1">return</span> result;
<span class="br0">}</span>
<span class="kw2">var</span> myHello = myFunction.<span class="me1">pass</span><span class="br0">(</span><span class="st0">'hello'</span><span class="br0">)</span>;
<span class="kw2">var</span> myItems = myFunction.<span class="me1">pass</span><span class="br0">(</span><span class="br0">[</span><span class="st0">'peach'</span>, <span class="st0">'apple'</span>, <span class="st0">'orange'</span><span class="br0">]</span><span class="br0">)</span>;
&nbsp;
<span class="co1">// Later in the code, the functions can be executed:</span>
<span class="kw3">alert</span><span class="br0">(</span>myHello<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>; <span class="co1">// passes 'hello' to myFunction.</span>
<span class="kw3">alert</span><span class="br0">(</span>myItems<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>; <span class="co1">// passes the array of items to myFunction.</span>
</pre>

<h3>See Also:</h3>

<p><a href="/#Function:bind">Function:bind</a></p>

<h2 id="Function:bind"><a href="#Function:bind">Function method: bind</a></h2>

<p class="description">Changes the scope of <code>this</code> within the target function to refer to the bind parameter.</p>

<h3>Syntax:</h3>

<pre class="javascript">myFunction.<span class="me1">bind</span><span class="br0">(</span><span class="br0">[</span>bind<span class="br0">[</span>, arg1, arg2, ...<span class="br0">]</span><span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>bind - (<em>object</em>, optional) The object that the "this" of the function will refer to.</li>
<li>arg1, arg2, ... - (<em>mixed</em>, optional) The arguments to pass to the function. If the bound function is called with other arguments the arguments are concatenated.</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>function</em>) The bound function.</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">function</span> myFunction<span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="co1">// Note that 'this' here refers to window, not an element.</span>
    <span class="co1">// the function must be bound to the element we want to manipulate.</span>
    <span class="kw1">this</span>.<span class="me1">setStyle</span><span class="br0">(</span><span class="st0">'color'</span>, <span class="st0">'red'</span><span class="br0">)</span>;
<span class="br0">}</span>;
<span class="kw2">var</span> myBoundFunction = myFunction.<span class="me1">bind</span><span class="br0">(</span>myElement<span class="br0">)</span>;
myBoundFunction<span class="br0">(</span><span class="br0">)</span>; <span class="co1">// makes myElement's text red</span>
&nbsp;
<span class="co1">// To show how bind works the following example:</span>
<span class="kw2">var</span> myBoundFunction = myFunction.<span class="me1">bind</span><span class="br0">(</span>anyVar<span class="br0">)</span>;
<span class="co1">// is roughly equivalent with</span>
<span class="kw2">var</span> myBoundFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">return</span> myFunction.<span class="me1">call</span><span class="br0">(</span><span class="kw1">this</span><span class="br0">)</span>;
<span class="br0">}</span>;
</pre>

<h3>See Also:</h3>

<p><a href="/#Function:pass">Function:pass</a></p>

<h2 id="Function:delay"><a href="#Function:delay">Function method: delay</a></h2>

<p class="description">Delays the execution of a function by a specified duration.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">var</span> timeoutID = myFunction.<span class="me1">delay</span><span class="br0">(</span>delay<span class="br0">[</span>, bind<span class="br0">[</span>, args<span class="br0">]</span><span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>delay - (<em>number</em>) The duration to wait (in milliseconds).</li>
<li>bind  - (<em>object</em>, optional) The object that the "this" of the function will refer to.</li>
<li>args  - (<em>mixed</em>, optional) The arguments passed (must be an array if the arguments are greater than one).</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>number</em>) The JavaScript timeout id (for clearing delays).</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">var</span> myFunction = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span> <span class="kw3">alert</span><span class="br0">(</span><span class="st0">'moo! Element id is: '</span> + <span class="kw1">this</span>.<span class="me1">id</span><span class="br0">)</span>; <span class="br0">}</span>;
&nbsp;
<span class="co1">//wait 50 milliseconds, then call myFunction and bind myElement to it</span>
myFunction.<span class="me1">delay</span><span class="br0">(</span><span class="nu0">50</span>, myElement<span class="br0">)</span>; <span class="co1">// alerts: 'moo! Element id is: ... '</span>
&nbsp;
<span class="co1">//an anonymous function which waits a second and then alerts</span>
<span class="br0">(</span><span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span> <span class="kw3">alert</span><span class="br0">(</span><span class="st0">'one second later...'</span><span class="br0">)</span>; <span class="br0">}</span><span class="br0">)</span>.<span class="me1">delay</span><span class="br0">(</span><span class="nu0">1000</span><span class="br0">)</span>;
&nbsp;
<span class="co1">//to stop the delay, clearTimeout can be used like so:</span>
<span class="kw2">var</span> timer = myFunction.<span class="me1">delay</span><span class="br0">(</span><span class="nu0">50</span><span class="br0">)</span>;
clearTimeout<span class="br0">(</span>timer<span class="br0">)</span>;
</pre>

<h3>See Also:</h3>

<ul>
<li>
<a href="https://developer.mozilla.org/en/DOM/window.setTimeout">MDC setTimeout</a>, <a href="https://developer.mozilla.org/en/DOM/window.clearTimeout">MDC clearTimeout</a>
</li>
</ul>
<h2 id="Function:periodical"><a href="#Function:periodical">Function method: periodical</a></h2>

<p class="description">Executes a function in the specified intervals of time. Periodic execution can be stopped using the <em>clearInterval</em> function.</p>

<h3>Syntax:</h3>

<pre class="javascript"><span class="kw2">var</span> intervalID = myFunction.<span class="me1">periodical</span><span class="br0">(</span>period<span class="br0">[</span>, bind<span class="br0">[</span>, args<span class="br0">]</span><span class="br0">]</span><span class="br0">)</span>;
</pre>

<h3>Arguments:</h3>

<ol>
<li>period - (<em>number</em>) The duration of the intervals between executions.</li>
<li>bind   - (<em>object</em>, optional) The object that the "this" of the function will refer to.</li>
<li>args   - (<em>mixed</em>, optional) The arguments passed (must be an array if the arguments are greater than one).</li>
</ol>
<h3>Returns:</h3>

<ul>
<li>(<em>number</em>) The Interval id (for clearing a periodical).</li>
</ul>
<h3>Example:</h3>

<pre class="javascript"><span class="kw2">var</span> Site = <span class="br0">{</span> counter: <span class="nu0">0</span> <span class="br0">}</span>;
<span class="kw2">var</span> addCount = <span class="kw2">function</span><span class="br0">(</span><span class="br0">)</span><span class="br0">{</span> <span class="kw1">this</span>.<span class="me1">counter</span>++; <span class="br0">}</span>;
addCount.<span class="me1">periodical</span><span class="br0">(</span><span class="nu0">1000</span>, Site<span class="br0">)</span>; <span class="co1">//adds the number of seconds at the Site.</span>
&nbsp;
<span class="co1">// the interval can be stopped using the clearInterval function</span>
<span class="kw2">var</span> timer = myFunction.<span class="me1">periodical</span><span class="br0">(</span><span class="nu0">1000</span><span class="br0">)</span>;
clearInterval<span class="br0">(</span>timer<span class="br0">)</span>;
</pre>

<h3>See Also:</h3>

<ul>
<li>
<a href="https://developer.mozilla.org/en/DOM/window.setInterval">MDC setInterval</a>, <a href="https://developer.mozilla.org/en/DOM/window.clearInterval">MDC clearInterval</a>
</li>
</ul>
<h1 id="Deprecated-Functions"><a href="#Deprecated-Functions">Deprecated Functions</a></h1>

<h2 id="Deprecated-Functions:create" class="description"><a href="#Deprecated-Functions:create">Function method: create</a></h2>

<p class="description">This function has been deprecated.</p>

<h2 id="Deprecated-Functions:bindWithEvent"><a href="#Deprecated-Functions:bindWithEvent">Function method: bindWithEvent</a></h2>

<p class="description">This function has been deprecated.</p>

<h3>Example how you could replace this method:</h3>

<pre class="javascript">myElement.<span class="me1">addEvent</span><span class="br0">(</span><span class="st0">'click'</span>, <span class="kw2">function</span><span class="br0">(</span>e<span class="br0">)</span><span class="br0">{</span>
    myFunction.<span class="me1">call</span><span class="br0">(</span>bind, e<span class="br0">)</span>;
<span class="br0">}</span><span class="br0">)</span>;
</pre>

<h2 id="Deprecated-Functions:run"><a href="#Deprecated-Functions:run">Function method: run</a></h2>

<p class="description">This function has been deprecated.</p>

<h3>Replacement example</h3>

<pre class="javascript">fn.<span class="me1">apply</span><span class="br0">(</span>thisArg, arguments<span class="br0">)</span>; <span class="co1">// Old API: fn.run(arguments, thisArg);</span>
</pre>
    </div>
  </div>
<script type="text/javascript" src="../../../assets/mootools-core-1.3.js"></script>
<script type="text/javascript" src="../../../assets/mootools-more-smoothscroll.js"></script>
<script type="text/javascript" src="../../../assets/doc-assist.js"></script>
</body>
</html>
